/****************************************************
    Author:            龙之介
    CreatTime:    #CreatTime#
    Description:     Nothing
*****************************************************/

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using ZYKTool;
using System.Linq;



namespace LongZhiJie
{
	public abstract class Gun基本属性:MonoBehaviour
	{
        #region 常量
        protected float _Damage;
        protected GameObject _projectile;//子弹预制体
        protected GameObject _shotEffect;//发射特效
        protected Transform _shotPoint;//发射点
        public EnumGun EnumGun;
        public float StartTimeBtwShots;//发射间隔
        public int Damage;//伤害
        public int BackForce;//后坐力
        public int Count;//发射数量
        public string Name;//名字

        //protected int 弹药数;
        #endregion

        #region 事件
        #endregion

        #region 字段
        #endregion


        #region 属性 
        #endregion


        #region 方法 
        private string UpdateDamage()
        {
            int damage = UnityEngine.Random.Range(5, 11);
            Damage += damage;
            return EnumGun.ToString()+"武器伤害增加" + damage.ToString();
        }
        private string UpdateStartTimeBtwShots()
        {
            float damage = UnityEngine.Random.Range(0.02f, 0.1f);
            StartTimeBtwShots -= damage;
            return EnumGun.ToString() + "武器射速增加" + damage.ToString();
        }
        private string UpdateCount()
        {
            Count += 1;
            return EnumGun.ToString() + "武器子弹增加" + 1.ToString();
        }

        public virtual string UpdateGun()
        {

            int rangeGun = UnityEngine.Random.Range(0, 8);
            switch (rangeGun)
            {
                case 1:return UpdateDamage();

   
                case 2:
                    return UpdateCount();
            
                case 3:
                    return UpdateStartTimeBtwShots();
                case 5: return UpdateDamage();
                case 4: return UpdateDamage();
                case 6:
                    return UpdateStartTimeBtwShots();

                default:return "升级失败";
            }

        }
        public virtual void Attack()
        {
            Destroy(Instantiate(_shotEffect, _shotPoint.position, Quaternion.identity),1);
        }
        public virtual void Init(GameObject projectile,GameObject shotEffect,Transform shotPoint)
        {

            _projectile = projectile;
            _shotEffect = shotEffect;
            _shotPoint = shotPoint;
        }
#endregion

        #region Unity回调
#endregion

        #region 事件回调
#endregion

        #region 帮助方法
#endregion

	}
}